package com.school.controller;

import com.school.entity.Notice;
import com.school.service.NoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/Notice")
public class NoticeController {
    @Autowired
    NoticeService service;

    // HttpServletRequest request, HttpServletResponse response

    @ResponseBody
    @RequestMapping("/getAll.do")
    public Notice[] getAll() {
        Notice[] notices = service.selectAll();
        return notices;
    }

}
